﻿<%@ Page Title="Mẫu tin nhắn" Language="C#" MasterPageFile="~/App_MasterPages/Aquarius.Master"
    AutoEventWireup="true" CodeBehind="MessagePatternManagement.aspx.cs" Inherits="PanasonicWarranty.UI.MessagePatternManagement"  %>

<%@ Register Src="../UserControl/ucPaging.ascx" TagName="ucPaging" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CssContent" runat="server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ScriptContent" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            RegisterDialog();
            ComboBox("ddlCateCode");
        });
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div class="row-fluid">
        <div class="span12">
            <div class="head">
                <div class="isw-grid"></div>
                <h1>Danh mục mẫu tin nhắn</h1>
         <%--       <ul class="buttons">
                    <li>
                        <asp:LinkButton CssClass="isw-plus" ID="lbtnAddNew" runat="server" 
                            onclick="lbtnAddNew_Click" />
                    </li>
                </ul>--%>
                <div class="clear">
                </div>
            </div>
            <div class="block-fluid table-sorting">
                <div class="dataTables_wrapper" id="tSortable_wrapper">
                    <div>
                        <uc1:ucPaging ID="pagingtop" runat="server" />
                    </div>
                    <asp:GridView ID="grvData" CssClass="table2 dataTable" runat="server" 
                        AutoGenerateColumns="false" Width="100%"
                        ShowHeaderWhenEmpty="true" onrowcommand="grvData_RowCommand">
                        <Columns>
                            <asp:TemplateField HeaderText="STT" ItemStyle-CssClass="STT">
                                <ItemTemplate>
                                    <%#(Container.DataItemIndex + 1) + (pagingtop.CurrentPage - 1) * pagingtop.PageSize%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="Mã mẫu tin" DataField="PatternCode" />
                            <asp:BoundField HeaderText="Nội dung mẫu tin" DataField="PatternMessage" />
                            <asp:BoundField HeaderText="Ghi chú" DataField="Description" />
                            <asp:TemplateField HeaderText="Chức năng" ItemStyle-CssClass="Function">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbtnEdit" Text="Sửa" runat="server"
                                        CommandName="Editing" CommandArgument='<%#Eval("PatternCode")%>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <div class="dataTables_info" id="tSortable_info">
                        <asp:Literal ID="ltrInfo" runat="server" />
                    </div>
                    <div class="dataTables_paginate paging_full_numbers" id="tSortable_paginate">
                        <uc1:ucPaging ID="pagingbottom" runat="server" />
                    </div>
                </div>
                <div class="clear">
                </div>
            </div>
        </div>
    </div>
    <div class="dialog" id="dialog1" title="Thông tin khách hàng" style="display: none;">
        <asp:Panel ID="pnlDialogBlock" runat="server" CssClass="block">
            <asp:HiddenField ID="hdfID" Value="" runat="server" />
            <table width="100%" cellpadding="2" cellspacing="2" >
                <tr>
                    <td>Mã mẫu tin</td>
                    <td><asp:TextBox ID="txtMessageCode" runat="server" Enabled="false" /></td>
                </tr>
                <tr>
                    <td>Nội dung mẫu tin</td>
                    <td><asp:TextBox ID="txtPattern" runat="server" TextMode="MultiLine" /></td>
                </tr>
                <tr>
                    <td>Ghi chú</td>
                    <td>
                        <asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine"/>
                    </td>
                </tr>
            </table>
            <div style="text-align:center; width:100%; color:Red"><asp:Label ID="lbError" runat="server" /></div>
            <div class="dr"><span></span></div>
            <div style="text-align: right">
                <asp:Button ID="btnSave" CssClass="btn" runat="server" Text="Lưu" 
                    onclick="btnSave_Click" />
                <input type="button" class="btn" value="Đóng" onclick="$('#dialog1').dialog('close'); return false;" />
            </div>
        </asp:Panel>
    </div>
</asp:Content>
